package org.liujing.jsw.client.ui;

import com.google.gwt.user.client.ui.*;
import org.liujing.jsw.client.border.*;
import org.liujing.jsw.client.ui.plaf.*;
import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.*;
import java.util.*;

public interface JComponent{
	public static final float TOP_ALIGNMENT = 0.0f;

    /**
     * Ease-of-use constant for <code>getAlignmentY</code> and
     * <code>getAlignmentX</code>. Specifies an alignment to
     * the center of the component
     * @see     #getAlignmentX
     * @see     #getAlignmentY
     */
    public static final float CENTER_ALIGNMENT = 0.5f;

    /**
     * Ease-of-use constant for <code>getAlignmentY</code>.  
     * Specifies an alignment to the bottom of the component.
     * @see     #getAlignmentY
     */
    public static final float BOTTOM_ALIGNMENT = 1.0f;

    /**
     * Ease-of-use constant for <code>getAlignmentX</code>. 
     * Specifies an alignment to the left side of the component.
     * @see     #getAlignmentX
     */
    public static final float LEFT_ALIGNMENT = 0.0f;

    /**
     * Ease-of-use constant for <code>getAlignmentX</code>.
     * Specifies an alignment to the right side of the component.
     * @see     #getAlignmentX
     */
    public static final float RIGHT_ALIGNMENT = 1.0f;
    
    public void setChildElementOffset(int x, int y);
	
	public int getChildElementOffsetX();
	
	public int getChildElementOffsetY();
	//public void updateUI();
	
	//public void setUI(ComponentUI newUI);
    
	public void onResize();
	public void onAttach();
	public void onDetach();
	public void addNotify();
	
	public void setDomElement(com.google.gwt.user.client.Element elem);
	
	public Element getDomElement();
	
	public void setContentElement(com.google.gwt.dom.client.Element elem);
	
	public Element getContentElement();
	public boolean isDomElementSet();
	
	public void removeNotify();
	
	public void setBorder(Border border);
    
    public Border getBorder();
	
	public void setParent(Container c);
	
	public Container getParent();
	
	public void invalidate();
    
    public void setPreferredSize(Dimension preferredSize);

    public boolean isPreferredSizeSet();

    public Dimension getPreferredSize();

    public void setMinimumSize(Dimension minimumSize);

    public boolean isMinimumSizeSet();

    public Dimension getMinimumSize();
    
    public void setMaximumSize(Dimension maximumSize);
    
    public boolean isMaximumSizeSet() ;

    public Dimension getMaximumSize();
    
    public Dimension getSize();
    
    public void setSize(int width, int height) ;
    
    public void setBounds(int x, int y, int width, int height);


    public void setSize(Dimension d);

    
    public float getAlignmentX();

    public float getAlignmentY();
    
    public void setAlignmentY(float alignmentY);
    
    public void setAlignmentX(float alignmentX);
    
    public boolean isValid();
    
    public ComponentOrientation getComponentOrientation();
    

    
    public Insets getInsets();
    
    public boolean contains(int x, int y);
    
    @Deprecated
    public boolean inside(int x, int y);
    
    public void revalidate();
    
    public boolean isVisible();
    
    public enum BaselineResizeBehavior {
        CONSTANT_ASCENT,
        CONSTANT_DESCENT,
        CENTER_OFFSET,
        OTHER
    }
}
